package main;

import java.io.FileNotFoundException;
import java.io.PrintStream;

import main.gui.NarwhalFrame;
import main.model.Settings;
import event.gui.EventFrame;
import event.model.NarwhalEvent;

public class Narwhal {
	public static void main(String[] args) {
		if (new Settings().logToFile()) {
			try {
				long time = System.currentTimeMillis();
				System.setErr(new PrintStream("log/error_" + time));
				System.setOut(new PrintStream("log/output_" + time));
			} catch (FileNotFoundException e) {
				System.err.println("Could not redirect outputstreams");
				e.printStackTrace();
			}
		}
		NarwhalEvent eventModel = new NarwhalEvent();
		EventFrame eventGUI = new EventFrame(eventModel);

		NarwhalFrame mainFrame = new NarwhalFrame();
		mainFrame.add(eventGUI);
	}
}
